﻿<UserControl x:Class="CalculatorProject.View.DisplayView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
           
             mc:Ignorable="d" 
             d:DesignHeight="50" Focusable="True">
    <!-- Keyboard actions -->
    <UserControl.InputBindings>
        <!-- Numbers (Both NumPad and Regular) -->
        <KeyBinding Key="Numpad1" Command="{Binding Path=KeyBoardCommand}" CommandParameter="1" />
        <KeyBinding Key="D1" Command="{Binding Path=KeyBoardCommand}" CommandParameter="1" />
        <KeyBinding Key="Numpad2" Command="{Binding Path=KeyBoardCommand}" CommandParameter="2" />
        <KeyBinding Key="D2" Command="{Binding Path=KeyBoardCommand}" CommandParameter="2" />
        <KeyBinding Key="Numpad3" Command="{Binding Path=KeyBoardCommand}" CommandParameter="3" />
        <KeyBinding Key="D3" Command="{Binding Path=KeyBoardCommand}" CommandParameter="3" />
        <KeyBinding Key="Numpad4" Command="{Binding Path=KeyBoardCommand}" CommandParameter="4" />
        <KeyBinding Key="D4" Command="{Binding Path=KeyBoardCommand}" CommandParameter="4" />
        <KeyBinding Key="Numpad5" Command="{Binding Path=KeyBoardCommand}" CommandParameter="5" />
        <KeyBinding Key="D5" Command="{Binding Path=KeyBoardCommand}" CommandParameter="5" />
        <KeyBinding Key="Numpad6" Command="{Binding Path=KeyBoardCommand}" CommandParameter="6" />
        <KeyBinding Key="D6" Command="{Binding Path=KeyBoardCommand}" CommandParameter="6" />
        <KeyBinding Key="Numpad7" Command="{Binding Path=KeyBoardCommand}" CommandParameter="7" />
        <KeyBinding Key="D7" Command="{Binding Path=KeyBoardCommand}" CommandParameter="7" />
        <KeyBinding Key="Numpad8" Command="{Binding Path=KeyBoardCommand}" CommandParameter="8" />
        <KeyBinding Key="D8" Command="{Binding Path=KeyBoardCommand}" CommandParameter="8" />
        <KeyBinding Key="Numpad9" Command="{Binding Path=KeyBoardCommand}" CommandParameter="9" />
        <KeyBinding Key="D9" Command="{Binding Path=KeyBoardCommand}" CommandParameter="9" />
        <KeyBinding Key="Numpad0" Command="{Binding Path=KeyBoardCommand}" CommandParameter="0" />
        <KeyBinding Key="D0" Command="{Binding Path=KeyBoardCommand}" CommandParameter="0" />

        <!-- Operators -->
        <KeyBinding Key="Add" Command="{Binding Path=KeyBoardCommand}" CommandParameter="+" />
        <KeyBinding Key="OemPlus" Modifiers="Shift" Command="{Binding Path=KeyBoardCommand}" CommandParameter="+" />
        <KeyBinding Key="OemMinus" Command="{Binding Path=KeyBoardCommand}" CommandParameter="-" />
        <KeyBinding Key="Subtract" Command="{Binding Path=KeyBoardCommand}" CommandParameter="-" />
        <KeyBinding Key="Multiply" Command="{Binding Path=KeyBoardCommand}" CommandParameter="*" />
        <KeyBinding Key="Divide" Command="{Binding Path=KeyBoardCommand}" CommandParameter="/" />
        <KeyBinding Key="Decimal" Command="{Binding Path=KeyBoardCommand}" CommandParameter="." />
        <KeyBinding Key="OemPeriod" Command="{Binding Path=KeyBoardCommand}" CommandParameter="." />
        <KeyBinding Key="D1" Modifiers="Shift" Command="{Binding Path=KeyBoardCommand}" CommandParameter="!" />
        <KeyBinding Key="D5" Modifiers="Shift" Command="{Binding Path=KeyBoardCommand}" CommandParameter="%" />
        <KeyBinding Key="D9" Modifiers="Shift" Command="{Binding Path=KeyBoardCommand}" CommandParameter="(" />
        <KeyBinding Key="D0" Modifiers="Shift" Command="{Binding Path=KeyBoardCommand}" CommandParameter=")" />

        <!-- Equal and Backspace -->
        <KeyBinding Key="OemPlus" Command="{Binding Path=KeyBoardCommand}" CommandParameter="=" />
        <KeyBinding Key="Enter" Command="{Binding Path=KeyBoardCommand}" CommandParameter="=" />
        <KeyBinding Key="Delete" Command="{Binding Path=KeyBoardCommand}" CommandParameter="←" />
        <KeyBinding Key="Backspace" Command="{Binding Path=KeyBoardCommand}" CommandParameter="←" />
    </UserControl.InputBindings>

    <Grid Focusable="True" FocusManager.FocusedElement="{Binding ElementName=textBlock1}">
        <TextBlock Height="300" FontSize="16" HorizontalAlignment="Left" Name="textBlock1" Text="{Binding Path=Expression}" VerticalAlignment="Top" TextWrapping="Wrap" Focusable="True" />
    </Grid>
</UserControl>
